﻿using System;
using System.Runtime.CompilerServices;
using AutoR.Services;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using Xamarin.Forms;

namespace AutoR.ViewModels
{
	// Token: 0x0200004D RID: 77
	public class ChangeLogViewModel : BindableBase, INavigationAware, INavigatedAware, INavigatingAware
	{
		// Token: 0x17000022 RID: 34
		// (get) Token: 0x060000FC RID: 252 RVA: 0x00040593 File Offset: 0x0003E793
		private INavigationService NavigationService { get; }

		// Token: 0x17000023 RID: 35
		// (get) Token: 0x060000FD RID: 253 RVA: 0x0004059B File Offset: 0x0003E79B
		// (set) Token: 0x060000FE RID: 254 RVA: 0x000405A4 File Offset: 0x0003E7A4
		public string VersionName
		{
			[CompilerGenerated]
			get
			{
				return this.<VersionName>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<VersionName>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<VersionName>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.VersionName);
			}
		}

		// Token: 0x17000024 RID: 36
		// (get) Token: 0x060000FF RID: 255 RVA: 0x000405D5 File Offset: 0x0003E7D5
		// (set) Token: 0x06000100 RID: 256 RVA: 0x000405E0 File Offset: 0x0003E7E0
		public string Log
		{
			[CompilerGenerated]
			get
			{
				return this.<Log>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<Log>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<Log>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Log);
			}
		}

		// Token: 0x17000025 RID: 37
		// (get) Token: 0x06000101 RID: 257 RVA: 0x00040611 File Offset: 0x0003E811
		public DelegateCommand BackCommand { get; }

		// Token: 0x17000026 RID: 38
		// (get) Token: 0x06000102 RID: 258 RVA: 0x00040619 File Offset: 0x0003E819
		public DelegateCommand OpenURLCommand { get; }

		// Token: 0x06000103 RID: 259 RVA: 0x00040624 File Offset: 0x0003E824
		public ChangeLogViewModel(INavigationService navigationService)
		{
			this.NavigationService = navigationService;
			this.BackCommand = new DelegateCommand(async delegate()
			{
				await this.NavigationService.GoBackAsync();
			});
			this.OpenURLCommand = new DelegateCommand(delegate()
			{
				Device.OpenUri((Device.RuntimePlatform == "Android") ? new Uri("https://jianghanxia.gitee.io/pages/AutoR.apk") : new Uri("https://leffs.cn/app.php/77"));
			});
		}

		// Token: 0x06000104 RID: 260 RVA: 0x0004067F File Offset: 0x0003E87F
		public void OnNavigatedFrom(INavigationParameters parameters)
		{
		}

		// Token: 0x06000105 RID: 261 RVA: 0x00040684 File Offset: 0x0003E884
		public async void OnNavigatedTo(INavigationParameters parameters)
		{
			this.VersionName = DependencyService.Get<ISystem>(DependencyFetchTarget.GlobalInstance).GetVersionName();
			string log = await Runtime.Remote.ChangeLog();
			this.Log = log;
		}

		// Token: 0x06000106 RID: 262 RVA: 0x0004067F File Offset: 0x0003E87F
		public void OnNavigatingTo(INavigationParameters parameters)
		{
		}
	}
}
